﻿<!-- 报告存档 -->
<template>
  <div>
    <card :bordered="false">
      <p slot=title>报告存档</p>
      <table class="reportArchives" width='100%' border="1" cellspacing="0" cellpadding="0" ref="print">
        <tr>
          <th colspan="4">报告存档表</th>
        </tr>
        <tr>
          <td width="25%">项目编号</td>
          <td colspan="3" class="sizeStyle">
            {{info.ProjectNumber}}
          </td>
        </tr>
        <tr>
          <td width="25%">项目名称</td>
          <td colspan="3" class="sizeStyle">
            {{info.ProjectName}}
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'projectName')" v-if='projectNameList.length>0'/>
            <Oldname v-if="projectName" :oldName="projectNameList"></Oldname>
            <!-- <Input v-model="info.Project_name" /> -->
          </td>
        </tr>
        <tr>
          <td width="25%">建设单位</td>
          <td colspan="3">
            <Input v-model="info.BuildUnit" :disabled='viewOnly'/>
            <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'buildName')" v-if='buildNameList.length>0'/>
            <Oldname v-if="buildName" :oldName="buildNameList"></Oldname>
          </td>
        </tr>
        <tr>
          <td width="25%">建设地点</td>
          <td colspan="3" class="sizeStyle">
            {{info.BuildAddress}}
            <!-- <Input v-model="info.Build_address" /> -->
          </td>
        </tr>

        <tr>
          <td width="25%">报告类型</td>
          <td colspan="3" class="sizeStyle">
            {{info.ReportType}}
            <!-- <Input v-model="info.Report_type" /> -->
          </td>
        </tr>
        <tr>
          <td width="25%">项目负责人</td>
          <td width="25%" class="sizeStyle">
            {{PerjectLeader}}
          </td>
          <td width="25%">项目组其他成员</td>
          <td class="sizeStyle">
            {{cyz}}
          </td>
        </tr>
        <tr>
          <td width="25%">审批部门</td>
          <td class="sizeStyle">{{info.ApprovalUnit}}</td>
          <td>踏勘时间</td>
          <td>
            <Input type="text" v-model="info.SurveyDate" :disabled="SurveyDate" />
            <!-- {{this.Survey_date}} -->
            <!-- {{this.$moment().format('YYYY-MM-DD')}} -->
          </td>
        </tr>
        <tr>
          <td width="25%">送审时间</td>
          <td>
            <Input type="text" v-model="info.AuditDate" :disabled="AuditDate" />
            <!-- {{this.$moment().format('YYYY-MM-DD')}} -->
          </td>
          <td>报批时间</td>
          <td>
            <Input type="text" v-model="info.BatchDate" :disabled="BatchDate" />
            <!-- {{this.$moment().format('YYYY-MM-DD')}} -->
          </td>
        </tr>
      </table>
    <!-- <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80"> -->
      <table v-if="!loading" class="cdzl" width='100%' border="1" cellspacing="0" cellpadding="0" style="margin: 10px 0 ">
        <tr>
          <th colspan="5">存档资料清单</th>
        </tr>
        <tr>
          <th width="3%">序号</th>
          <th colspan="2">名称</th>
          <th>文件</th>
          <th>纸质存档数</th>
        </tr>
        <tr>
          <td width="3%">1</td>
          <td colspan="2">项目合同</td>
          <td>
            <Col span="12">
              <UploadFile v-model="info.ProjectContract" :upName="upInfo.ProjectContract" UploadFileName="ProjectContract" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
              <DownloadButton :stats="!downloadInfo.ProjectContract" :downData="downloadInfo.ProjectContract"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <!-- <FormItem prop="isNumber"> -->
              <Input v-model="bigs[0].B.DataStock" @on-blur="isNumber(0)" :disabled='viewOnly'/>
              <p v-show="verification.verContract">请输入纸质存档数</p>
            <!-- </FormItem> -->
          </td>
        </tr>
        <tr>
          <td width="3%">2</td>
          <td colspan="2">项目委托书</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.ProjectTrustInstrument" :upName="upInfo.ProjectTrustInstrument" UploadFileName="ProjectTrustInstrument" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.ProjectTrustInstrument" :downData="downloadInfo.ProjectTrustInstrument"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <!-- <FormItem prop="Project_contract"> -->
              <Input v-model="bigs[1].B.DataStock" @on-blur="isNumber(1)" :disabled='viewOnly'/>
              <p v-show="verification.verInstrument">请输入纸质存档数</p>
            <!-- </FormItem> -->
          </td>
        </tr>
        <tr>
          <td width="3%">3</td>
          <td colspan="2">现场踏勘表</td>
          <td>
            <Col span="12">
            <span>&nbsp;</span>
            </Col>
            <Col span="12">
            <Button type="info" @click="downTrip">下载</Button>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[2].B.DataStock" @on-blur="isNumber(2)" :disabled='viewOnly'/>
            <p v-show="verification.verStock">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">4</td>
          <td colspan="2">项目周围现状图</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.ProjectStatusMap" :upName="upInfo.ProjectStatusMap" UploadFileName="ProjectStatusMap" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.ProjectStatusMap" :downData="downloadInfo.ProjectStatusMap"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[3].B.DataStock" @on-blur="isNumber(3)" :disabled='viewOnly'/>
            <p v-show="verification.verPic">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">5</td>
          <td colspan="2">审核</td>
          <td>
              <Button :disabled="tofStateOne" @click="firstInstance" >一审</Button>
              <Button :disabled="tofStateTwo" @click="secondInstance" >二审</Button>
              <Button :disabled="tofStateThr" @click="firstTrial" >初审</Button>
              <Button :disabled="tofStateFou" @click="reExamine" >复审</Button>
              <Button :disabled="tofStateFiv" @click="lastInstance" >终审</Button>
            <!-- <Row>
              <Col span="4"> -->
                <!-- <Button>一审</Button> -->
              <!-- </Col>
              <Col span="4"> -->
                <!-- <Button>二审</Button> -->
              <!-- </Col>
              <Col span="4"> -->
                <!-- <Button>初审</Button> -->
              <!-- </Col>
              <Col span="4"> -->
                <!-- <Button>复审</Button> -->
              <!-- </Col>
              <Col span="4"> -->
                <!-- <Button>终审</Button> -->
              <!-- </Col>
            </Row> -->
          </td>
          <td class="archives">
            <Input v-model="bigs[4].B.DataStock" @on-blur="isNumber(4)" :disabled='viewOnly'/>
            <p v-show="verification.verLev">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">6</td>
          <td colspan="2">
            项目批复或审批文件
          </td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.AuditData" :upName="upInfo.AuditData" UploadFileName="AuditData" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.AuditData" :downData="downloadInfo.AuditData"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[5].B.DataStock" @on-blur="isNumber(5)" :disabled='viewOnly'/>
            <p v-show="verification.verBatch">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">7</td>
          <td colspan="2">评估意见、签字表（原件或复印件）</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.AppraiseData" :upName="upInfo.AppraiseData" UploadFileName="AppraiseData" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.AppraiseData" :downData="downloadInfo.AppraiseData"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[6].B.DataStock" @on-blur="isNumber(6)" :disabled='viewOnly'/>
            <p v-show="verification.verAssessment">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">8</td>
          <td colspan="2">环评执行标准文件（原件或复印件）</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.StandardExecution" :upName="upInfo.StandardExecution" UploadFileName="StandardExecution" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.StandardExecution" :downData="downloadInfo.StandardExecution"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[7].B.DataStock" @on-blur="isNumber(7)" :disabled='viewOnly'/>
            <p v-show="verification.verEia">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">9</td>
          <td colspan="2">环境监测报告原件</td>
          <td>
            <Col span="12">
            
            <UploadFile v-model="info.QuoteReport" :upName="upInfo.QuoteReport" UploadFileName="QuoteReport" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/> （引用数据）
             <UploadFile v-model="info.ActualTestReport" :upName="upInfo.ActualTestReport" UploadFileName="ActualTestReport" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>（监测数据）
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.QuoteReport" :downData="downloadInfo.QuoteReport"></DownloadButton> {{"&nbsp;"}}
            <DownloadButton :stats="!downloadInfo.ActualTestReport" :downData="downloadInfo.ActualTestReport"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[8].B.DataStock" @on-blur="isNumber(8)" :disabled='viewOnly'/>
            <p v-show="verification.verMonitor">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%" rowspan="8">10</td>
          <td rowspan="8" width="5%">公参相关</td>
          <td width="29%">建设单位公用参与承诺函（原件）</td>
          <td width="30%">
            <Col span="12">
            <UploadFile v-model="info.BuildPublicPromise" :upName="upInfo.BuildPublicPromise" UploadFileName="BuildPublicPromise" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.BuildPublicPromise" :downData="downloadInfo.BuildPublicPromise"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[9].B.DataStock" @on-blur="isNumber(9)" :disabled='viewOnly'/>
            <p v-show="verification.verPublic">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">两次公示（建设单位用章）网上公示截图及网址</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.PublicPrintscreenUrl" :upName="upInfo.PublicPrintscreenUrl" UploadFileName="PublicPrintscreenUrl" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.PublicPrintscreenUrl" :downData="downloadInfo.PublicPrintscreenUrl"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[10].B.DataStock" @on-blur="isNumber(10)" :disabled='viewOnly'/>
            <p v-show="verification.verPrintscreen">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">公众参与调查表</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.PublicCens" :upName="upInfo.PublicCens" UploadFileName="PublicCens" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.PublicCens" :downData="downloadInfo.PublicCens"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[11].B.DataStock" @on-blur="isNumber(11)" :disabled='viewOnly'/>
            <p v-show="verification.verCens">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">公参提交意见的原始文件</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.PublicOpinion" :upName="upInfo.PublicOpinion" UploadFileName="PublicOpinion" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.PublicOpinion" :downData="downloadInfo.PublicOpinion"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[12].B.DataStock" @on-blur="isNumber(12)" :disabled='viewOnly'/>
            <p v-show="verification.verOpinion">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">公众参与专题报告（建设单位盖章）</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.PublicSpecialReports" :upName="upInfo.PublicSpecialReports" UploadFileName="PublicSpecialReports" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.PublicSpecialReports" :downData="downloadInfo.PublicSpecialReports"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[13].B.DataStock" @on-blur="isNumber(13)" :disabled='viewOnly'/>
            <p v-show="verification.verSpecial">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">听证会相关资料</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.HearingData" :upName="upInfo.HearingData" UploadFileName="HearingData" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.HearingData" :downData="downloadInfo.HearingData"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[14].B.DataStock" @on-blur="isNumber(14)" :disabled='viewOnly'/>
            <p v-show="verification.verHearing">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">座谈会相关资料</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.ForumData" :upName="upInfo.ForumData" UploadFileName="ForumData" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.ForumData" :downData="downloadInfo.ForumData"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[15].B.DataStock" @on-blur="isNumber(15)" :disabled='viewOnly'/>
            <p v-show="verification.verForum">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">或建设单位公参单行本</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.BuildPublicText" :upName="upInfo.BuildPublicText" UploadFileName="BuildPublicText" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.BuildPublicText" :downData="downloadInfo.BuildPublicText"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[16].B.DataStock" @on-blur="isNumber(16)" :disabled='viewOnly'/>
            <p v-show="verification.verPublicText">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">11</td>
          <td colspan="2">送审版报告</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.ReportAuditor" :upName="upInfo.ReportAuditor" UploadFileName="ReportAuditor" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.ReportAuditor" :downData="downloadInfo.ReportAuditor"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[17].B.DataStock" @on-blur="isNumber(17)" :disabled='viewOnly'/>
            <p v-show="verification.verReport">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">12</td>
          <td colspan="2">报批版报告</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.ReportBatch" :upName="upInfo.ReportBatch" UploadFileName="ReportBatch" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.ReportBatch" :downData="downloadInfo.ReportBatch"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[18].B.DataStock" @on-blur="isNumber(18)" :disabled='viewOnly'/>
            <p v-show="verification.verReportBat">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">13</td>
          <td colspan="2">建设单位提供的其他报告</td>
          <td>
            <Col span="12">
            <UploadFile v-model="info.BuildOtherData" :upName="upInfo.BuildOtherData" UploadFileName="BuildOtherData" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/>
            </Col>
            <Col span="12">
            <DownloadButton :stats="!downloadInfo.BuildOtherData" :downData="downloadInfo.BuildOtherData"></DownloadButton>
            </Col>
          </td>
          <td class="archives">
            <Input v-model="bigs[19].B.DataStock" @on-blur="isNumber(19)" :disabled='viewOnly'/>
            <p v-show="verification.verOther">请输入纸质存档数</p>
          </td>
        </tr>
        <tr>
          <td width="3%">14</td>
          <td colspan="2">
            <Icon type="ios-medical" color="#ff6868" />
            纸质资料存档位置
          </td>
          <td class="archives">
            <Input v-model.trim="bigs[20].A.Url" :disabled='viewOnly' @on-blur='isHasInner'/>
            <p v-show="isShow">请输入资料存档位置</p>
          </td>
          <td class="archives">
            <Input v-model="bigs[20].B.DataStock" @on-blur="isNumber(20)" :disabled='viewOnly'/>
            <p v-show="verification.overOther">请输入纸质存档数</p>
          </td>
        </tr>
      </table>
    <!-- </Form> -->
      <table class="dayj" v-if="!loading" width='100%' border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td width="25%">档案员意见</td>
          <td>
            <Input type="textarea" v-model="data1[0].ArchivistsOpinion" :disabled='UserOrg==7?false:true'/>
            <!-- <Input v-model="info.Archivists_opinion" :disabled='userOrg==7?false:true'/> -->
          </td>
        </tr>
      </table>
      <Row type="flex" justify="space-between" class="topmargin">
        <Col span="4">
        <PrintButton v-if="flag" Url="print/printArchives" :Project_id="info.Id"></PrintButton>
        </Col>
        <Col span="10">
        <!-- 档案员 -->
        <div v-if="UserOrg == 7" style="float: right">
          <Button v-if='this.info.File == 1? true:false' type="primary" @click="submit('archivist',$event)" :disabled='viewOnly'>发送意见</Button>
          <Button v-if='this.info.File == 1? true:false' type="primary" @click="submit('save',$event)" :disabled='viewOnly'>保存</Button>
          <Button v-if='this.info.File == 1? true:false' type="primary" @click="submit('submit')" :disabled='viewOnly'>提交</Button>
        </div>
        <!-- 提交人员 -->
        <div v-else style="float: right">
          <Button v-if='this.info.File == 0? true:false' type="primary" @click="submit('save',$event)" :disabled='viewOnly'>保存</Button>
          <Button v-if='this.info.File == 0? true:false' type="primary" @click="submit('submit')" :disabled='viewOnly'>提交</Button>
        </div>
        </Col>
      </Row>
      <StepBar :status="9" :viewOnly='viewOnly'/>
      <!-- <StepBar :status="9" /> -->
    </card>

  </div>
</template>

<script>
  import libs from "../../../libs/uploads";
  export default {
    data() {
      const validatorNumber = (rule,value,callback) =>{
        if(value == ''){
          console.log(value)
          callback(new Error('请输入纸质存档数'))
        }else{
          console.log('2')
          callback()
        }
      }
      return {
        // 项目负责人
        PerjectLeader: '',
        tofStateOne: true,
        tofStateTwo: true,
        tofStateThr: true,
        tofStateFou: true,
        tofStateFiv: true,
        downOne: '',
        downTwo: '',
        downThr: '',
        downFou: '',
        downFiv: '',
        // 项目名称、建设单位、法人、联系人、联系电话留痕列表
        projectName: false,
        buildName: false,
        downloadInfo: {},
        projectNameList: [], 
        buildNameList: [],
        viewOnly: false,  // 允许查看
        flag: false,
        info: {},
        cyz: "",
        bigs: {},
        data1: {},
        loading: true,
        archives: false,
        isShow: false,
        upInfo: {
          ProjectContract: "",
          ProjectTrustInstrument: "",
          AuditData: "",
          ProjectBatchData: "",
          AppraiseData: "",
          BuildPublicPromise: "",
          ProjectStatusMap: "",
          PublicPrintscreenUrl: "",
          PublicCens: "",
          PublicOpinion: "",
          PublicSpecialReports: "",
          HearingData: "",
          ForumData: "",
          BuildPublicText: "",
          BuildOtherData: "",
          ReportBatch: "",
          ReportAuditor: "",
          StandardExecution: "",
          ActualTestReport: "",
          QuoteReport:"",
        },
        StaffNameId: "",
        verification: {
          verContract: false,
          verInstrument: false,
          verStock: false,
          verPic: false,
          verLev: false,
          verBatch: false,
          verAssessment: false,
          verEia: false,
          verMonitor: false,
          verPublic: false,
          verPrintscreen: false,
          verCens: false,
          verOpinion: false,
          verSpecial: false,
          verHearing: false,
          verForum: false,
          verPublicText: false,
          verReport: false,
          verReportBat: false,
          verOther: false,
          overOther: false,
        },
        updatedInfo: 0,
        setButton: 0,
        setArcTime: 0,
        SurveyDate: false,
        AuditDate:false,
        BatchDate:false,
        UserOrg: '',
      };
    },
    mounted() {
      let query = this.$route.query;
      this.query = query;
      // this.getProject(this.query.id);
      //判断是否有ID
      if (this.$route.query.ProjectId && this.$route.query.ProjectId != "") {
        this.getProject(this.$route.query.ProjectId);
        if(this.$route.query.viewOnly==1) {
          this.viewOnly = true
        }else {
          this.UserOrg = localStorage.getItem('userOrg')
        }
      } else {
        //跳转首页
        this.$router.push({
          name: "index"
        });
      }
      // 项目成员组
      this.findStaffs();
      // 资料表
      this.showAll(this.query.ProjectId || this.query.Id);
      axios.post('wechatpublic/findImg',{
        Id:this.$route.query.ProjectId
      }).then(res=>{
        for(var i = 0;i<res.data.length;i++){
          if(res.data[i].Status == '一审'){
            this.tofStateOne = false;
            this.downOne = res.data[i].ImgUrl
          }else if(res.data[i].Status == '二审'){
            this.tofStateTwo = false;
            this.downTwo = res.data[i].ImgUrl
          }else if(res.data[i].Status == '初审'){
            this.tofStateThr = false;
            this.downThr = res.data[i].ImgUrl
          }else if(res.data[i].Status == '复审'){
            this.tofStateFou = false;
            this.downFou = res.data[i].ImgUrl
          }else if(res.data[i].Status == '终审'){
            this.tofStateFiv = false;
            this.downFiv = res.data[i].ImgUrl
          }else{

          }
        }
      })
    },
    methods: {
      firstInstance(){              //一审
        window.open(this.downOne)
      },
      secondInstance(){
        window.open(this.downTwo)
      },
      firstTrial(){
        window.open(this.downThr)
      },
      reExamine(){
        window.open(this.downFou)
      },
      lastInstance(){
        window.open(this.downFiv)
      },
      // 纸质资料存档位置不能为空
      isHasInner() {
        if(this.bigs[20].A.Url) {
          this.isShow = false
        }else {
          this.isShow = true
        }
      },
      // 名字去重显示
      viewClick(e,nameShow) {
        if(!this[nameShow]) {
          e.target.className = 'ivu-icon ivu-icon-ios-arrow-up'
        }else {
          e.target.className = 'ivu-icon ivu-icon-ios-arrow-down'
        }
        this[nameShow] = !this[nameShow]
      },
      showAll(ProjectId) {
        axios
          .get("/projectArchive/showAll", {
            params: {
              ProjectId
            }
          }).then(res => {
            if (res._STATUS == 1) {
              this.bigs = res.bigs;
              this.data1 = res.data1;
              // this.data1[0].Archivists_opinion = "";
              this.loading = false;
            }
          });
      },
      downTrip(){
        window.open(libs.uploads2() + 'print/printSurver?ProjectId=' + this.$route.query.ProjectId)
      },
      // picDown(){
        
      // },
      /* 获取当前创建项目 */
      getProject(Id) {
        this.$post('ProjectInfo.findProjectByID', {
              Id: Id || this.$route.query.ProjectId
          })
          .then(res => {
            this.PerjectLeader = res.PerjectLeader  //项目负责人
            this.info = res.info;
            console.log(res.info);
            if(this.info.SurveyDate){
              this.SurveyDate = true
            }
            if(this.info.AuditDate){
              this.AuditDate = true
            }
            if(this.info.BatchDate){
              this.BatchDate = true
            }
            this.downloadInfo = res.doc
            console.log(res)
            // 项目名字留痕
            if(res.pt2List.length>0) {
              var arrAll = res.pt2List //所有更改记录
              function arrayUnique2(arr, ProjectName) {
                var hash = {};
                return arr.reduce(function (item, next) {
                  hash[next[ProjectName]] ? '' : hash[next[ProjectName]] = true && item.push(next);
                  return item;
                }, []);
              }
              var projectNameList = arrayUnique2(arrAll, "ProjectName")
              if(projectNameList[0].ProjectName==this.info.ProjectName) {
                projectNameList = arrayUnique2(arrAll, "ProjectName").slice(1)
              }
              projectNameList.forEach(e => {
                this.projectNameList.push({name: e.ProjectName,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var buildNameList = arrayUnique2(arrAll, "BuildUnit")
              if(buildNameList[0].BuildUnit==this.info.BuildUnit) {
                buildNameList = arrayUnique2(arrAll, "BuildUnit").slice(1)
              }
              buildNameList.forEach(e => {
                this.buildNameList.push({name: e.BuildUnit,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });           
            }
            
            localStorage.projectType = this.info.PerjectType;
            this.flag = true
            this.upInfo.ProjectContract = this.upWord(res.doc.ProjectContract)
            console.log(this.upInfo.ProjectTrustInstrument);
            this.upInfo.AuditData = this.upWord(res.doc.AuditData)
            this.upInfo.ProjectTrustInstrument = this.upWord(res.doc.ProjectTrustInstrument)
            this.upInfo.ProjectBatchData = this.upWord(res.doc.ProjectBatchData)
            this.upInfo.StandardExecution = this.upWord(res.doc.StandardExecution)
            this.upInfo.ActualTestReport = this.upWord(res.doc.ActualTestReport)
            this.upInfo.QuoteReport = this.upWord(res.doc.QuoteReport)
            this.upInfo.AppraiseData = this.upWord(res.doc.AppraiseData)
            this.upInfo.ProjectStatusMap = this.upWord(res.doc.ProjectStatusMap)
            this.upInfo.BuildPublicPromise = this.upWord(res.doc.BuildPublicPromise)
            this.upInfo.PublicPrintscreenUrl = this.upWord(res.doc.PublicPrintscreenUrl)
            this.upInfo.PublicCens = this.upWord(res.doc.PublicCens)
            this.upInfo.PublicOpinion = this.upWord(res.doc.PublicOpinion)
            this.upInfo.PublicSpecialReports = this.upWord(res.doc.PublicSpecialReports)
            this.upInfo.HearingData = this.upWord(res.doc.HearingData)
            this.upInfo.ForumData = this.upWord(res.doc.ForumData)
            this.upInfo.BuildPublicText = this.upWord(res.doc.BuildPublicText)
            this.upInfo.BuildOtherData = this.upWord(res.doc.BuildOtherData)
            this.upInfo.ReportBatch = this.upWord(res.doc.ReportBatch)
            this.upInfo.ReportAuditor = this.upWord(res.doc.ReportAuditor)
          })
          .catch(err => {
            console.log(err)
            this.$Message.error('请求失败!')
          });
      },
      findStaffs() {
        axios.get("/audit/findStaffs2", {
            params: {
              ProjectId: this.query.Id || this.query.ProjectId
            }
          }).then(res => {
            this.cyz = res.data
            this.StaffNameId = res.StaffsId
          });
      },
      projectArchiveSaveAllFn() {
        let bigs = this.bigs
        bigs = new Array(bigs)
        let data1 = this.data1
        axios.post('/projectArchive/SaveAll', {
          ProjectId: data1[0].Id,
          ArchivistsOpinion: data1[0].ArchivistsOpinion,
          Bigs:JSON.stringify(bigs)
        }).then(res => {
        }).catch(err => {
          alert('提交失败')
        })
      },
      // 保存 save / 提交 submit
      submit(type,event) {
        let info = this.info;
        debugger
        info.ArchivistsOpinion = this.data1[0].ArchivistsOpinion;
        info.DocumentStorageLocation = this.bigs[20].A.Url;
        info.BtnWay = type == "save" ? 1 : 2;
        info.PerjectType = type == "save" ? 15 : 15;
        if(type == 'save'){
          this.isHasInner()
          if(this.UserOrg != 7  && !this.isShow){
            info.File = '0'
          }else if(!this.isShow){
            info.File = '1'
          }
          // 档案员加上无意见提示并不让发送
          if((this.data1[0].ArchivistsOpinion == '' || this.data1[0].ArchivistsOpinion == null)&&this.UserOrg==7) {
            this.$Modal.warning({
                title: '提示信息',
                content: '未填写意见，无意见不可发送或保存！',
            });  
            return
          }
          if(this.setButton == 0){
            this.setButton = 1
            setTimeout(()=>{this.setButton = 0},60000)
            //判断填写是否完整
            if(this.bigs[20].A.Url){
              this.isShow = false
              this.projectArchiveSaveAllFn();
              if(this.UserOrg==7) {
                info.File = '1'
              }else {
                info.File = '0'
              }
              axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
                if (res._STATUS == 1) {
                  let title = res._MESSAGE
                    this.$Modal.info({
                      title: '提示信息',
                      // content: '发送意见成功！',
                      content: '保存意见成功！',
                      onOk: ()=>{
                        this.$router.push({
                          name: "underway",
                        })
                      }
                    });
                } else {
                  this.$Modal.error({
                    title,
                  })
                }
              }).catch(err => {
                console.log(err)
                this.setButton = 0
              })
            }else{
              /**保存设置填写是否完整 */
              this.isShow = true
              this.setButton = 0
              return
            }
          }else{
            /**重复提交 */
            this.$Message.warning('连续点击保存时间过短，最少间隔1分钟!')
          }
        }else if(type == 'archivist'){
          if((this.data1[0].ArchivistsOpinion == '' || this.data1[0].ArchivistsOpinion == null)&&this.UserOrg==7) {
            this.$Modal.warning({
                title: '提示信息',
                content: '未填写意见，无意见不可发送或保存！',
            });  
            return
          }
          info.BtnWay = 1
          info.File = '0'
          if(this.setArcTime == 0){
            this.setArcTime = 1
            setTimeout(()=>{this.setArcTime = 0},50000)
            info.UserOrg = '1'
            this.projectArchiveSaveAllFn();
            axios.post('/projectInformation/saveOrUpdateProject', info).then((res)=>{
              if(res._STATUS == 1){
                social({
                  method: 'post',
                  url: '/info/notice',
                  params: {
                    content: this.info.ProjectName + '项目存档资料存在问题，请补充完善后进行存档！',
                    app_name: '环评管控系统',
                    app: 'eao',
                    type: this.info.PerjectLeader + '',
                    uid: -1
                  },
                }).then((res)=>{console.log(res)}).catch(err=>{console.log(err)})
                social({
                  method: 'post',
                  url: '/info/notice',
                  params: {
                    content: this.info.ProjectName + '项目存档资料存在问题，请补充完善后进行存档！',
                    app_name: '环评管控系统',
                    app: 'eao',
                    type: this.StaffNameId + '',
                    uid: -1
                  },
                }).then((res)=>{console.log(res)}).catch(err=>{console.log(err)})
                this.$Modal.info({
                  title: '提示信息',
                  // content: '发送意见成功！',
                  content: '发送意见成功！',
                  onOk: ()=>{
                    this.$router.push({
                      name: "underway",
                    })
                  }
                });
              }else{
                this.$Modal.error({
                  title,
                })
              }
            }).catch(err => {
              console.log(err)
              this.setArcTime = 0
            })
          }else{
            this.$Message.warning('意见已发送，请勿重复发送意见!')
          }
        }else{
          this.isHasInner()
          if(this.UserOrg != 7 && !this.isShow){
            info.File = '1'
          }else if(!this.isShow){
            info.File = '2'
          }
          console.log(info.File)
          if(this.updatedInfo == 0){
            this.updatedInfo = 1
            setTimeout(()=>{this.updatedInfo = 0},60000)
            //判断填写是否完整
            console.log(this.bigs[20].A.Url)
            if(this.bigs[20].A.Url != ''){
              this.isShow = false
              this.projectArchiveSaveAllFn();
              if(this.UserOrg==7) {
                info.UserOrg = '1'
              }else {
                info.UserOrg = '0'
              }
              axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
                if (res._STATUS == 1) {
                  let title = res._MESSAGE
                    if(this.UserOrg==7) {  /**档案员提交 */
                      axios.get('member/findByMembers').then((res)=>{
                        var members = res.members
                        if(!(members==null||members=="")) {
                          social({
                            method: 'post',
                            url: '/info/notice',
                            params: {
                              content: this.info.ProjectName + '项目已提交存档，进入项目库，项目结束！',
                              app_name: '环评管控系统',
                              app: 'eao',
                              type: members,
                              uid: -1
                            },
                          }).then((res)=>{console.log(res)})
                        }
                        social({
                          method: 'post',
                          url: '/info/notice',
                          params: {
                            content: this.info.ProjectName + '项目已提交存档，进入项目库，项目结束！',
                            app_name: '环评管控系统',
                            app: 'eao',
                            type: this.PerjectLeader + '',
                            uid: -1
                          },
                        }).then((res)=>{console.log(res)})
                        social({
                          method: 'post',
                          url: '/info/notice',
                          params: {
                            content: this.info.ProjectName + '项目已提交存档，进入项目库，项目结束！',
                            app_name: '环评管控系统',
                            app: 'eao',
                            type: this.StaffNameId + '',
                            uid: -1
                          },
                        }).then((res)=>{console.log(res)})
                      }).catch((err)=>{
                        console.log(err)
                      })
                      this.$Message.success('提交成功！')
                      this.$router.push({
                        name: "myProjectStock",
                      })
                    }else {       /** 非档案员提交 */
                      axios.post('member/findByMembers',{
                        Filer: 1
                      }).then((res)=>{
                        console.log(res)
                        var members = res.members
                        if(!(members==null||members=="")) {
                          social({
                            method: 'post',
                            url: '/info/notice',
                            params: {
                              content: this.info.ProjectName + '项目已提交存档，请检查项目电子资料和纸质存档材料是否合格!',
                              app_name: '环评管控系统',
                              app: 'eao',
                              type: members,
                              uid: -1
                            },
                          }).then((res)=>{console.log(res)})
                        }
                      }).catch()
                      this.$Modal.info({
                        title: '提示信息',
                        content: '等待档案员审核！',
                        onOk: ()=>{
                          this.$router.push({
                            name: "underway",
                          })
                        }
                      });
                    }
                } else {
                  this.$Modal.error({
                    title,
                  })
                }
              }).catch(err => {this.$Message.error('提交失败！')})
            }else{
              this.isShow = true
              this.updatedInfo = 0
            }
          }else{
            this.$Message.warning('连续点击提交时间过短，最少间隔1分钟!')
          }
        }
      },
      upWord(url){        //分割字符串
        if(url == null){
          return '上传'
        }else{
          var upWord = url;
          upWord = upWord.split("/");
          upWord = upWord.slice(-1);
          upWord = upWord.join('');
          // console.log(upWord)
          return upWord
        }
      },
      isNumber(num){
        switch(num){
          case 0:
            if(/^[0-9]*$/.test(this.bigs[0].B.DataStock) && this.bigs[0].B.DataStock != ''){
              this.verification.verContract = false
            }else{
              this.verification.verContract = true
            }
            break;
          case 1:
            if(/^[0-9]*$/.test(this.bigs[1].B.DataStock) && this.bigs[1].B.DataStock != ''){
              this.verification.verInstrument = false
            }else{
              this.verification.verInstrument = true
            }
            break;
          case 2:
            if(/^[0-9]*$/.test(this.bigs[2].B.DataStock) && this.bigs[2].B.DataStock != ''){
              this.verification.verStock = false
            }else{
              this.verification.verStock = true
            }
            break;
          case 3:
            if(/^[0-9]*$/.test(this.bigs[3].B.DataStock) && this.bigs[3].B.DataStock != ''){
              this.verification.verPic = false
            }else{
              this.verification.verPic = true
            }
            break;
          case 4:
            if(/^[0-9]*$/.test(this.bigs[4].B.DataStock) && this.bigs[4].B.DataStock != ''){
              this.verification.verLev = false
            }else{
              this.verification.verLev = true
            }
            break;
          case 5:
            if(/^[0-9]*$/.test(this.bigs[5].B.DataStock) && this.bigs[5].B.DataStock != ''){
              this.verification.verBatch = false
            }else{
              this.verification.verBatch = true
            }
            break;
          case 6:
            if(/^[0-9]*$/.test(this.bigs[6].B.DataStock) && this.bigs[6].B.DataStock != ''){
              this.verification.verAssessment = false
            }else{
              this.verification.verAssessment = true
            }
            break;
          case 7:
            if(/^[0-9]*$/.test(this.bigs[7].B.DataStock) && this.bigs[7].B.DataStock != ''){
              this.verification.verEia = false
            }else{
              this.verification.verEia = true
            }
            break;
          case 8:
            if(/^[0-9]*$/.test(this.bigs[8].B.DataStock) && this.bigs[8].B.DataStock != ''){
              this.verification.verMonitor = false
            }else{
              this.verification.verMonitor = true
            }
            break;
          case 9:
            if(/^[0-9]*$/.test(this.bigs[9].B.DataStock) && this.bigs[9].B.DataStock != ''){
              this.verification.verPublic = false
            }else{
              this.verification.verPublic = true
            }
            break;
          case 10:
            if(/^[0-9]*$/.test(this.bigs[10].B.DataStock) && this.bigs[10].B.DataStock != ''){
              this.verification.verPrintscreen = false
            }else{
              this.verification.verPrintscreen = true
            }
            break;
          case 11:
            if(/^[0-9]*$/.test(this.bigs[11].B.DataStock) && this.bigs[11].B.DataStock != ''){
              this.verification.verCens = false
            }else{
              this.verification.verCens = true
            }
            break;
          case 12:
            if(/^[0-9]*$/.test(this.bigs[12].B.DataStock) && this.bigs[12].B.DataStock != ''){
              this.verification.verOpinion = false
            }else{
              this.verification.verOpinion = true
            }
            break;
          case 13:
            if(/^[0-9]*$/.test(this.bigs[13].B.DataStock) && this.bigs[13].B.DataStock != ''){
              this.verification.verSpecial = false
            }else{
              this.verification.verSpecial = true
            }
            break;
          case 14:
            if(/^[0-9]*$/.test(this.bigs[14].B.DataStock) && this.bigs[14].B.DataStock != ''){
              this.verification.verHearing = false
            }else{
              this.verification.verHearing = true
            }
            break;
          case 15:
            if(/^[0-9]*$/.test(this.bigs[15].B.DataStock) && this.bigs[15].B.DataStock != ''){
              this.verification.verForum = false
            }else{
              this.verification.verForum = true
            }
            break;
          case 16:
            if(/^[0-9]*$/.test(this.bigs[16].B.DataStock) && this.bigs[16].B.DataStock != ''){
              this.verification.verPublicText = false
            }else{
              this.verification.verPublicText = true
            }
            break;
          case 17:
            if(/^[0-9]*$/.test(this.bigs[17].B.DataStock) && this.bigs[17].B.DataStock != ''){
              this.verification.verReport = false
            }else{
              this.verification.verReport = true
            }
            break;
          case 18:
            if(/^[0-9]*$/.test(this.bigs[18].B.DataStock) && this.bigs[18].B.DataStock != ''){
              this.verification.verReportBat = false
            }else{
              this.verification.verReportBat = true
            }
            break;
          case 19:
            if(/^[0-9]*$/.test(this.bigs[19].B.DataStock) && this.bigs[19].B.DataStock != ''){
              this.verification.verOther = false
            }else{
              this.verification.verOther = true
            }
            break;
          case 20:
            if(/^[0-9]*$/.test(this.bigs[20].B.DataStock) && this.bigs[20].B.DataStock != ''){
              this.verification.overOther = false
            }else{
              this.verification.overOther = true
            }
            break;
        }
      },
    },
  };
</script>


<style lang="less">
  .dayj,
  .cdzl,
  .reportArchives {
    td.sizeStyle {
      font-size:12px;
    }
    textarea.ivu-input {
      font-size: 12px;
    }
    .ivu-input {
      border: none !important;
      text-align: center;
      height: 30px;

      input {
        outline: medium;
      }
    }
    .ivu-input[disabled], fieldset[disabled] .ivu-input {
      background-color: #fff; 
      color: #333;
      font-size: 12px;
    }
  }
  .archives{
      position: relative;
    p{
      position: absolute;
      bottom: 0;
      right: 0;
      color: red;
      font-size: 10px;
    }
  }
</style>